<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .wrap {
      width: 500px;
      height: 500px;
      border: 1px solid #ccc;
      overflow: auto;
      position: relative;
    }

    .content {
      height: 2000px;
      width: 2000px;
      background-color: yellowgreen;
    }

    /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
    .wrap::-webkit-scrollbar {
      width: 11px;
      height: 11px;
      background-color: #f5f5f500;
      position: absolute;
      right: 0;
    }

    /*定义滚动条轨道 内阴影+圆角*/
    .wrap::-webkit-scrollbar-track {
      /* -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); */
      border-radius: 10px;
      background-color: #f5f5f500;
    }

    /*定义滑块 内阴影+圆角*/
    .wrap::-webkit-scrollbar-thumb {
      border-radius: 10px;
      border: 3px solid rgba(0, 0, 0, 0);
      box-shadow: 0 5px 0 red inset;

    }
  </style>
</head>

<body>
  <div class="wrap">
    <div class="content"></div>
  </div>
</body>

</html>